package android.slc.db_room.core;

import android.slc.db_room.sys.entity.CsConfig;
import android.slc.db_room.sys.service.CsConfigDao;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.blankj.utilcode.util.Utils;

import org.jetbrains.annotations.NotNull;

/**
 * @author slc
 * @date 2024/6/3
 **/
@Database(entities = {CsConfig.class}, version = 1, exportSchema = false)
public abstract class AppRoomDatabase extends RoomDatabase {

    public static class Holder {
        public static AppRoomDatabase ROOM_DATABASE = Room.databaseBuilder(Utils.getApp(), AppRoomDatabase.class, "app_database").fallbackToDestructiveMigration().build();
    }

    @NotNull
    public static AppRoomDatabase getInstance() {
        return Holder.ROOM_DATABASE;
    }

    public abstract CsConfigDao csConfigDao();
}
